<%@ page language="java" import="java.util.*" pageEncoding="Utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>开元名都大酒店网站</title>

<link rel="stylesheet" href="${pageContext.request.contextPath}/common/style/qdh.css" type="text/css" media="screen" />
<link rel="stylesheet" href="${pageContext.request.contextPath}/common/style/member.css" type="text/css" media="screen" />
<link rel="stylesheet" href="${pageContext.request.contextPath}/common/src/css/jscal2.css" type="text/css" media="screen" />
<script type="text/javascript" src="${pageContext.request.contextPath}/common/js/jquery-1.7.2.min.js"></script>
<script src="${pageContext.request.contextPath}/common/src/js/jscal2.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/common/src/js/lang/cn.js" type="text/javascript"></script>

<script>
function GetDateStr(AddDayCount) 
{ 
var dd = new Date(); 
dd.setDate(dd.getDate()+AddDayCount);//获取AddDayCount天后的日期 
var y = dd.getFullYear(); 
var m = dd.getMonth()+1;//获取当前月份的日期 
var d = dd.getDate(); 
if(m>=10&&d>=10){
	return y+"-"+m+"-"+d; 
}else if(m<10&&d>=10){
	return y+"-0"+m+"-"+d; 
}else if(m>=10&&d<10){
	return y+"-"+m+"-0"+d; 
}else{
	return y+"-0"+m+"-0"+d; 
}
}
$(function(){
	$("#checkinTime,#checkoutTime").click(function(){$(".DynarchCalendar-bottomBar").remove();})
	var start="${checkinTime}";
	if(start==""){
		$("#checkinTime").val(GetDateStr(1));
		$("#checkoutTime").val(GetDateStr(2));	
	}else{
		$("#checkinTime").val("${checkinTime}");
		$("#checkoutTime").val("${checkoutTime}");	
	}
	$(window).scrollTop()>0?$("#backtotop").fadeIn():$("#backtotop").fadeOut();
 	$(window).bind('scroll',function(){ 
 	$(this).scrollTop()>0?$("#backtotop").fadeIn():$("#backtotop").fadeOut();
 });
 			
 });
 
 function scroll(){
 	$("body,html").animate({scrollTop:0},500);
 }
function urlreplace(){
	history.replaceState("", "", "index.action");
}
</script>
</head>
<body onload="urlreplace();">
<div id="wrap">
<div id="backtotop" onclick="scroll();"><a id="top"  ></a></div>
<s:include value="header.jsp"></s:include>
	<div id="container">
		<div class="hotel-contentbox">
			<div class="hotel-content-titlebox">
				<h1 class="fl hotel-content-title">${hotel.name}</h1>
				<div class="fr hotel-lowestprice">每间每晚<span>￥${hotel.minPrice}</span>起</div>
				<div class="clr"></div>
				<div class="hotel-add">地址：${hotel.address}<font class="fr" style="font-size:14px;color:#FF662A;">电话：${hotel.tel}</font></div>
			</div>
			
			<div class="mt10 hotel-content-top">	
				<div class="fr hotel-content-info">
					<div class="hotel-content-intro">
						<div class="hotel-content-introbox">
							<h1>酒店简介</h1>
							<div class="hotel-content-introcontent">${hotel.summary }</div>
						</div>
					</div>
				</div>
			</div>
			<div class="mt10 detailbox">
				<div class="detailtab">
					<ul>
						<li class="selected"><a href="javascript:;" title="酒店预订" id="fjyd">房间预订</a></li>
						<li><a href="#jdxq" title="酒店详情">酒店详情</a></li>
						<li><a href="#ydxz" title="预定须知">预定须知</a></li>
						<li><a href="#zkdp" title="住客点评">住客点评</a></li>
						<li><a href="#zbjt" title="周边交通">周边交通</a></li>
					</ul>
				</div>
				<div class="hotel-content-price">
					<div class="hotel-content-pricebox">
						<div class="mt10 hotel-content-showprice">					
							<div class="hotel-content-data">
							<form action="getRoomLeft.action" method="post">
								入住日期：<input type="text" id="checkinTime" name="checkinTime" />
								退房日期：<input type="text"  id="checkoutTime" name="checkoutTime" />
								<input type="submit"   value=""  class="sbtn" /><font style="color:red;margin-left:10px;">需提前一天预订</font>
							</form>
							<script type="text/javascript">
								Calendar.setup({
								weekNumbers: true,
								inputField : "checkinTime",
								trigger: "checkinTime",
								dateFormat: "%Y-%m-%d",
								minuteStep: 1,
								disabled : function(date) {									
								return (date <= new Date());
								 },
								onSelect: function() {
									this.hide();									
									var end=$("#checkoutTime").val();
									var start=$("#checkinTime").val();
									if(start>=end){
									var date= Calendar.intToDate(this.selection.get());
									date.setDate(date.getDate()+1)
									date =Calendar.printDate(date, "%Y-%m-%d");
									$("#checkoutTime").val(date);
									}									
								}
								});								
								Calendar.setup({
								weekNumbers: true,
								inputField : "checkoutTime",
								trigger : "checkoutTime",
								dateFormat: "%Y-%m-%d",
								minuteStep: 1,
								disabled: function(date) {
								var str = $("#checkinTime").val();								
								str=str.replace(/-/g,"/")+" 00:00:00";
								var d = new Date(str);
								d.setDate(d.getDate()+1)
								return (date < d);
								 },
								onSelect   : function() {
								this.hide();
								 }
								});
							</script>					
							</div>
						
							<div class="hotel-content-showprice-title">
								<span class="fl hoteltype">房型</span>
								<span class="fl bedtype">床型</span>
								<span class="fl bedtype">早餐</span>
								<span class="fl bedtype">宽带</span>
								<span class="fl pricenum">价格</span>
								<span class="fr option">操作</span>
							</div>																	
							<ul>
								<s:iterator  value="roomlist" var="x">
										<li>
									<span class="fl hoteltype"><a href="javascript:void();" onmouseover="toolTip('<img src=${pageContext.request.contextPath}/${x.picUrl}>')" onmouseout="toolTip()">${x.name}</a></span>
									
									<span class="fl bedtype">${x.bedTypeName}</span>
										<s:if test="#x.breakfast==0">
											<span class="fl breakfast">无早</span>
										</s:if>
										<s:elseif test="#x.breakfast==1">
											<span class="fl breakfast">免费</span>
										</s:elseif> 
										<s:else>
											<span class="fl breakfast">收费</span>
										</s:else>
										<s:if test="#x.broadband==0">
											<span class="fl breakfast">无</span>
										</s:if>
										<s:elseif test="#x.broadband==1">
											<span class="fl breakfast">免费</span>
										</s:elseif>
										<s:else>
											<span class="fl breakfast">收费</span>
										</s:else>
									<span class="fl pricenum"><strong>¥${x.price}</strong></span>
									<span class="fr option">
									<s:if test="#x.isAvailable==1">
									<a href="javascript:;"  onclick="order(${x.id});" class="ydbtn">预订</a>								
									</s:if>
									<s:else>
									<a href="javascript:;"  class="notleft">订完</a>
									</s:else>
									</span>								
								</li>								
								</s:iterator>
							</ul>
						</div>
					</div>					
				</div>
				<script>
					function order(id){
						var checkinTime=$("#checkinTime").val();
						var checkoutTime=$("#checkoutTime").val();
						location.href="${pageContext.request.contextPath}/view/cart/hotelBuy.action?id="+id+"&checkinTime="+checkinTime+"&checkoutTime="+checkoutTime;
					}
				</script>
				<div class="blockbox">
					<span class="blocktitle">酒店详情<a id="jdxq"></a></span>
					<div class="blockboxdetail">${hotel.introduction}</div>
				</div>
				<div class="blockbox">
					<span class="blocktitle">预定须知<a id="ydxz"></a></span>
					<div class="blockboxdetail">${hotel.orderNote}</div>
				</div>
	
				<div class="blockbox" id="review">
					<span class="blocktitle">住客点评<a id="zkdp"></a></span>
					<div class="blockboxdetail">
						<div class="commentbox">
								<div class="commenttop">
									<div class="fl mark"><strong>
									<s:if test="%{hotel.goodComment.length()>4}">
										<s:property value="%{hotel.goodComment.substring(0,5)}"/>%
									</s:if>
									<s:else>
										${hotel.goodComment}%
									</s:else>
									</strong><br/>客户总体满意度<br/>已有<b>${hotel.comment}</b>条评价</div>

									<div class="fr docomment">
										<a href="${pageContext.request.contextPath}/view/member/getOrderList.action" title="我要点评"><img src="${pageContext.request.contextPath}/common/image/docomment.jpg"  alt="我要点评"/></a><br/>完成一次订单才能点评
									</div>
								</div>
						</div>
							<div class="reviewtab commentlist1">
							<div id="reviewcontent">
							<ul>
							<s:iterator value="review" id="x">
							<li><span class="fl reviewuser">
							<s:if test="%{#x.userName.length()>5}"><s:property value="%{#x.userName.substring(0,5)}"/>*</s:if><s:else>${x.userName}</s:else><br/>
							<s:date name="#x.entryDate" format="yyyy-MM-dd "/></span>
							<div class="fl">
							<dl>
							<dd>	
								对<span class="reviewinfo">${x.roomName}</span>发表
								<s:if test="#x.comment==1">
									<img src="${pageContext.request.contextPath}/common/image/ping1.gif"/>
								</s:if>
								<s:elseif test="#x.comment==2">
								<img src="${pageContext.request.contextPath}/common/image/ping0.gif"/>
								</s:elseif>
								<s:else>
								<img src="${pageContext.request.contextPath}/common/image/ping-1.gif"/>
								</s:else>
							</dd>
							<dd class="reviewcontent"><span >${x.remark}</span></dd></dl></div></li>

							</s:iterator>
							</ul>
							</div>
							<div class="fr listpage" style="margin:10px 30px">${pagination}</div>   
							</div>
					</div>
				</div>

				<div class="blockbox">
					<span class="blocktitle">周边交通<a id="zbjt"></a></span>
					<div class="blockboxdetail">
						
						<div class="mt10 zbjt">
							
							<div class="zbjtbox">${hotel.traffic}</div>
						</div>
					</div>
				</div>
				
			</div>
		</div>
		<div class="clr"></div>
	</div>
	<div id="footer">
	<p><span>版权所有：</span><span>浙江财经学院 09电子商务1 潘风平</span></p>	
</div>
</div>
<script src="${pageContext.request.contextPath}/common/js/ToolTip.js" type="text/javascript"></script>
</body>
</html>
